﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NGUYENTHANHDONG.Excercise.Bai2
{
    class MODEL
    {
        public double PhepTinh(Calculator cal)
        {
            double temp = 0;
            if(cal.THUTUPHEPTINH == 0)
            {
                temp = cal.SOTHU1 + cal.SOTHU2;
                
            }
            else if(cal.THUTUPHEPTINH == 1)
            {
                temp = cal.SOTHU1 - cal.SOTHU2;
                
            }
            else if (cal.THUTUPHEPTINH == 2)
            {
                temp = cal.SOTHU1 * cal.SOTHU2;

            }
            else if (cal.THUTUPHEPTINH == 3)
            {
                temp = cal.SOTHU1 / cal.SOTHU2;

            }

            return temp;
        }
    }
}
